home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / perl5 / Net / DBus / Binding / Message / MethodCall.pm < prev    next >
Encoding:
Perl POD Document  |  2008-02-20  |  2.3 KB  |  102 lines

  1. # -*- perl -*-
  2. #
  3. # Copyright (C) 2004-2006 Daniel P. Berrange
  4. #
  5. # This program is free software; You can redistribute it and/or modify
  6. # it under the same terms as Perl itself. Either:
  7. #
  8. # a) the GNU General Public License as published by the Free
  9. #   Software Foundation; either version 2, or (at your option) any
  10. #   later version,
  11. #
  12. # or
  13. #
  14. # b) the "Artistic License"
  15. #
  16. # The file "COPYING" distributed along with this file provides full
  17. # details of the terms and conditions of the two licenses.
  18.  
  19. =pod
  20.  
  21. =head1 NAME
  22.  
  23. Net::DBus::Binding::Message::MethodCall - a message encoding a method call
  24.  
  25. =head1 DESCRIPTION
  26.  
  27. This module is part of the low-level DBus binding APIs, and
  28. should not be used by application code. No guarentees are made
  29. about APIs under the C<Net::DBus::Binding::> namespace being
  30. stable across releases.
  31.  
  32. This module provides a convenience constructor for creating
  33. a message representing a method call. 
  34.  
  35. =head1 METHODS
  36.  
  37. =over 4
  38.  
  39. =cut
  40.  
  41.  
  42. package Net::DBus::Binding::Message::MethodCall;
  43.  
  44. use 5.006;
  45. use strict;
  46. use warnings;
  47.  
  48. use Net::DBus;
  49. use base qw(Exporter Net::DBus::Binding::Message);
  50.  
  51. =item my $call = Net::DBus::Binding::Message::MethodCall->new(
  52.   service_name => $service, object_path => $object, 
  53.   interface => $interface, method_name => $name);
  54.  
  55. Create a message representing a call on the object located at
  56. the path C<object_path> within the client owning the well-known
  57. name given by C<service_name>. The method to be invoked has
  58. the name C<method_name> within the interface specified by the
  59. C<interface> parameter.
  60.  
  61. =cut
  62.  
  63. sub new {
  64.     my $proto = shift;
  65.     my $class = ref($proto) || $proto;
  66.     my %params = @_;
  67.  
  68.     my $msg = exists $params{message} ? $params{message} :
  69.     Net::DBus::Binding::Message::MethodCall::_create
  70.     (
  71.      ($params{service_name} ? $params{service_name} : die "service_name parameter is required"),
  72.      ($params{object_path} ? $params{object_path} : die "object_path parameter is required"),
  73.      ($params{interface} ? $params{interface} : die "interface parameter is required"),
  74.      ($params{method_name} ? $params{method_name} : die "method_name parameter is required"));
  75.  
  76.     my $self = $class->SUPER::new(message => $msg);
  77.  
  78.     bless $self, $class;
  79.     
  80.     return $self;
  81. }
  82.  
  83. 1;
  84.  
  85. __END__
  86.  
  87. =back
  88.  
  89. =head1 AUTHOR
  90.  
  91. Daniel P. Berrange.
  92.  
  93. =head1 COPYRIGHT
  94.  
  95. Copyright (C) 2005-2006 Daniel P. Berrange
  96.  
  97. =head1 SEE ALSO
  98.  
  99. L<Net::DBus::Binding::Message>
  100.  
  101. =cut
  102.